package builder.AssetFormBuilderPackage;

import java.awt.GridBagConstraints;

import handler.assetFormHandlers.AFDeleteButtonActionListener;
import handler.assetFormHandlers.AFEditButtonActionListener;

import javax.swing.JButton;

import builder.FormBuilder;
import builder.FormBuilderDecorator;
import form.AssetForm.AssetForm;

public class UpdateDecorator extends FormBuilderDecorator {

	
	public UpdateDecorator(FormBuilder decoratee){
		super(decoratee);
	}
	
	
	public void setFormSettings() {
		// TODO Auto-generated method stub
		super.setFormSettings();
		
	}

	@Override
	public void buildComponents() {
		// TODO Auto-generated method stub
		super.buildComponents();
		
		AssetForm assetForm = (AssetForm) decoratee.getForm();

		GridBagConstraints c = new GridBagConstraints();
				
		JButton btnUpdate = new JButton("Update Asset");
		btnUpdate.addActionListener(new AFEditButtonActionListener(assetForm));
		c.gridx = 1;
		c.gridy = 0;
		assetForm.add(btnUpdate, c);

		JButton btnDelete = new JButton("Delete Asset");
		btnDelete.addActionListener(new AFDeleteButtonActionListener(assetForm));
		c.gridx = 2;
		c.gridy = 0;
		assetForm.add(btnDelete, c);
	} 
	
	
	
}
